home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / backup / kbackup-.000 / KBackup-1.2.7.tar / KBackup / kbinstall < prev    next >
Text File  |  1996-03-27  |  7KB  |  298 lines

  1. #!/bin/sh
  2. #
  3. #    KBInstall: Installation program for KBackup
  4. #
  5. #    Copyright (C) 1995,1996 by Karsten Ballueder
  6. #            see manual for copyright details
  7. #
  8. #    /home/kbackup/.CVSROOT/KBackup/kbinstall,v 1.18 1996/03/25 17:22:05 kbackup Exp
  9.  
  10. KBACKUP_VERSION="1.2.7"
  11.  
  12. DIALOG_SRC_FILE=src/dialog
  13.  
  14. if [ "$1" = --ttymode ]
  15. then
  16.     echo "Entering tty-mode..."
  17.     TTYMODE=YES
  18. fi
  19.  
  20. . src/paths
  21. . src/checkprogs
  22.  
  23. check_progs
  24.  
  25. DIALOGTITLE="KBackup Installation Program               (C) 1995, 1996 by Karsten Ballueder"
  26.  
  27. # show copyright:
  28. $DIALOG --title " KBackup Installation: Copyright and Conditions of use" --textbox COPYING 22 77 
  29.  
  30. if [ "$UID" != "0" ]
  31. then
  32.     if ! $DIALOG --title " personal installation? " --yesno \
  33. "
  34. It seems that you are not the superuser (root). To
  35. install KBackup and its support files properly, you
  36. should have root privileges. 
  37. Of course, as a normal user, you can also install
  38. KBackup in your own directories, but this is not
  39. recommended.
  40.  
  41.            Continue with installation?
  42. " 14 56
  43.     then
  44.         exit 0
  45.     fi
  46. fi
  47.  
  48. # report missing programs:
  49. if [ "$HasNot" != "" ]
  50. then
  51.     if ! $DIALOG --title " Error! " --yesno \
  52. "
  53. KBackup requires some other programs to be installed on your system.
  54. It seems that the following programs are not yet installed:
  55. $HasNot
  56.  
  57. If they should already be installed, you can edit the 'paths' file in
  58. this directory to make sure KBackup can find them. Otherwise, you should
  59. install them, or KBackup will not work properly.
  60.  
  61. In the manual you can find further information on where to get those
  62. programs. You can also check the WWW KBackup homepage at:
  63. http://www.uni-karlsruhe.de/~Karsten.Ballueder
  64.  
  65.                     Continue with installation?
  66. " 18 77
  67.     then
  68.         exit 0
  69.     fi
  70. fi
  71.  
  72.  
  73. # ask for directories:
  74.  
  75. if $DIALOG --title " KBackup data directory " --inputbox "
  76. KBackup maintains several user defined configurations and creates
  77. rather big logfiles during operation. 
  78. As it is able to read backups without access to these files, they
  79. can be safely put on a mounted filesystem. 
  80. A reasonable place for them would be \"$kbackdir\".
  81.  
  82. Press ENTER to confirm this default, or enter a path of your
  83. choice:
  84. " 18 76 2>/tmp/.tmp$$
  85. then
  86.     ddir=`cat /tmp/.tmp$$`
  87.     if [ "$ddir" != "" ]
  88.     then
  89.         kbackdir=$ddir
  90.     fi
  91. fi
  92. datadir="$kbackdir/Data"
  93.  
  94.  
  95. if $DIALOG --title " KBackup program directory " --inputbox "
  96. Where do you want to install the \"kbackup\" program itself?
  97.  
  98. A reasonable place for this would be \"$progdir\".
  99.  
  100. Press ENTER to confirm this default, or enter a path of your 
  101. choice:
  102. " 15 76 2>/tmp/.tmp$$
  103. then
  104.     pdir=`cat /tmp/.tmp$$`
  105.     if [ "$pdir" != "" ]
  106.     then
  107.         progdir=$pdir
  108.     fi
  109. fi
  110.  
  111. if $DIALOG --title " KBackup config directory " --inputbox "
  112. KBackup needs a place where to store its configuration files
  113. and some of its source. These files should be available whenever
  114. it is run, so they should be put somewhere on the root filesystem.
  115.  
  116. A reasonable place for them would be \"$srcdir\".
  117.  
  118. Press ENTER to confirm this default, or enter a path of your 
  119. choice:
  120. " 18 76 2>/tmp/.tmp$$
  121. then
  122.     sdir=`cat /tmp/.tmp$$`
  123.     if [ "$sdir" != "" ]
  124.     then
  125.         srcdir=$sdir
  126.     fi
  127. fi
  128.  
  129.  
  130. # MultiBuf:
  131.  
  132. #if ! [ -x multibuf/multibuf ]
  133. #then
  134. $DIALOG --title " KBackup: Installation of MultiBuf" --infobox "
  135. For handling multi-volume archives, KBackup uses the MultiBuf 
  136. program included in this distribution. It will now be compiled
  137. from its source. 
  138.  
  139. Compiling MultiBuf program...  (should take just few seconds)
  140.  
  141. " 9 67
  142.  
  143.  
  144. cd multibuf 
  145. if ! make multibuf >/dev/null 2>/dev/null
  146. then
  147.     $DIALOG --title " Installation error! " --msgbox "
  148.  
  149. Couldn't compile multibuf program!
  150.  
  151. KBackup needs it for its operation, so
  152. you have to go to the multibuf/ directory,
  153. compile it yourself and install somewhere
  154. in your binaries path (e.g. /bin).
  155.  
  156. Sorry.    (Please, report this bug!)" 15 60
  157. fi
  158. cd ..
  159.  
  160. #fi
  161.  
  162. $DIALOG --title " KBackup Installation " --infobox "
  163. Creating directories...  " 5 40
  164.  
  165. install -m 0755 -d $kbackdir
  166.  
  167. if [ -d $kbackdir/Default ]
  168. then
  169.     $DIALOG --title " KBackup Installation " --yesno "
  170. Old KBackup data files found 
  171. (Configuration-/Log-Files).
  172.  
  173. Do you want to keep them?"  9  35
  174.     if [ $? = 0 ]
  175.     then    
  176.         install -m 0755 -d $datadir
  177.         tmp=`pwd`
  178.         ( cd $kbackdir; for i in * ; do install -m 0755 -d $datadir/$i.old && cp -ar $kbackdir/$i $datadir/$i.old && rm -rf $i ; done ) 
  179.         cd "$tmp"
  180.     else
  181.         rm -rf $kbackdir/*
  182.     fi
  183. fi
  184. install -m 0755 -d $kbackdir
  185. install -m 0755 -d $datadir
  186. cd data
  187. for i in * ; do install -m 0755 -d $datadir/$i ; done
  188. cd ..
  189. install -d $progdir
  190. install -d $srcdir
  191.  
  192.  
  193. $DIALOG --title " KBackup Installation " --infobox "
  194. Installing config files / source..." 5 40 
  195.  
  196. cd src
  197. echo "# settings added by kbinstall:
  198. datadir=\"$datadir\"
  199. docdir=\"$docdir\"
  200. progdir=\"$progdir\"
  201. srcdir=\"$srcdir\"
  202. kbackdir=\"$kbackdir\"
  203. " | cat paths - >tmp$$ && mv tmp$$ paths
  204.  
  205. install -m 0644 * $srcdir
  206. cd ..
  207.  
  208. $DIALOG --title " KBackup Installation " --infobox "
  209. Installing Programs..." 5 40 
  210.  
  211. echo -e "#!/bin/sh\nSRCDIR=$srcdir\n" | cat - kbackup >.tmp$$ 
  212. mv kbackup kbackup.bak
  213. mv .tmp$$ kbackup
  214. install    -m a=rx kbackup $progdir
  215. mv kbackup.bak kbackup
  216.  
  217. rm -f $progdir/multibuf    # otherwise file gets longer and longer, bug in install?
  218. install -s multibuf/multibuf $progdir
  219. install -m 0644 multibuf/multibuf.1 /usr/man/man1
  220. install -m 0644 docs/kbackup.1 /usr/man/man1
  221.  
  222. $DIALOG --title " KBackup Installation " --infobox "
  223. Installing sample configurations...  " 5 40
  224.  
  225. cd data
  226. for i in * ; do install -m 0644 $i/* $datadir/$i ; done
  227. cd ..
  228.  
  229. cat >$HOME/.kbackrc <<_EOF_
  230. #
  231. # KBackup rc file
  232. #
  233. kbackdir=$kbackdir
  234. datadir=$datadir
  235. configname=Default
  236. _EOF_
  237.  
  238. $DIALOG --title " KBackup Installation " --infobox "
  239. Installing documentation in 
  240. \"$docdir\"..." 6 40
  241.  
  242. install -d $docdir
  243. install -d $docdir/html
  244. install -m 0644 docs/* $docdir 2>/dev/null
  245. install -m 0644 docs/html/* $docdir/html 
  246.  
  247. if [ "$HasAFIO" = "NO" ]
  248. then
  249.     if $DIALOG --title " KBackup Installation " --yesno "
  250. It seems that you don't have the afio(1) program installed.
  251.  
  252. Do you want to use the binary included in this package?
  253. (This is HIGHLY recommended! It's in ELF format.)
  254. " 10 70
  255.     then
  256.         $DIALOG --title " KBackup Installation " --infobox "
  257. Installing afio in /bin, /usr/man/man1
  258. " 6 45
  259.         install -m 0755 tools/bin/afio /bin
  260.         install -m 0644 tools/man/afio.1 /usr/man/man1
  261.     fi
  262. fi
  263.  
  264. if [ "$DIALOG" = "dialog" ]    # Ah, still using version 0.3...
  265. then
  266.     if $DIALOG --title " KBackup Installation " --yesno "
  267. The version of the dialog(1) program installed on your system
  268. is outdated. 
  269. Do you want to replace it by the one from this package?
  270.  
  271. (This is no official version, I made some minor patches and
  272. recompiled it to be 8bit clean. In a.out format.)
  273. " 9 75
  274.     then
  275.         $DIALOG --title " KBackup Installation " --infobox "
  276. Installing dialog in /bin, /usr/man/man1
  277. " 6 47
  278.         install -m 0755 tools/bin/dialog /bin
  279.         install -m 0644 tools/man/dialog.1 /usr/man/man
  280.     fi
  281. fi
  282.  
  283. rm -f /tmp/.tmp$$
  284.  
  285. $DIALOG --title " KBackup Installation " --msgbox "
  286. Installation of KBackup is complete.
  287.  
  288. Its documentation can be found under \"$docdir\".
  289. For further information and latest notes, you can refer to
  290. the KBackup home page in the WWW:
  291.  
  292. http://www.uni-karlsruhe.de/~Karsten.Ballueder
  293.  
  294. To start the program, type \"kbackup\".
  295. " 16 63
  296. clear
  297.  
  298.